package models

import "github.com/goravel/framework/database/orm"

type SysMenu struct {
	orm.Model
	Type        int       `json:"type"`
	Name        string    `json:"name"`
	ParentId    int64     `json:"parent_id"`
	OrderNum    int       `json:"order_num"`
	Path        string    `json:"path"`
	Component   string    `json:"component"`
	QueryParams string    `json:"query_params"`
	Icon        string    `json:"icon"`
	IsFrame     bool      `json:"is_frame"`
	IsCache     bool      `json:"is_cache"`
	Visible     bool      `json:"visible"`
	Children    []SysMenu `json:"children" gorm:"foreignKey:parent_id"`
}

func NewSysMenu() *SysMenu {
	return &SysMenu{}
}

func (SysMenu) TableName() string {
	return "sys_menu"
}
